NB_THREADS= 3
ALGORITHM= 1
TRY= 1
SUFFIX=

CFLAGS=-g -O0 -Wall -lrt -pthread -DALGORITHM=$(ALGORITHM) -DNB_THREADS=$(NB_THREADS)
FILES=array.* cons dec inc Makefile rand sort.* sort_main.c Subject/report.pdf
ARCHIVE=Lab2.zip

TARGET=sort$(SUFFIX)

all: $(TARGET)

clean:
	$(RM) sort
	$(RM) sort-*
	$(RM) *.o
	$(RM) *.zip
	
sort: sort_main.c sort.o
	gcc $(CFLAGS) -o $(TARGET) sort.o array.o sort_main.c

sort.o: sort.c array.o
	gcc $(CFLAGS) -c -o sort.o sort.c
	
array.o: array.c
	gcc $(CFLAGS) -c -o array.o array.c

.PHONY: all clean dist

dist:
	zip $(ARCHIVE) $(FILES)
